while True:
    try:
        number1=float(input('请输入你的第一个数字：'))

        operator=input('请输入操作符\n(+ - * /)\n')

        number2=float(input('请输入你的第二个数字：'))

        if operator == "+":
            result = number1 + number2 
        elif operator == "-":
            result = number1 - number2 
        elif operator == "*":
            result = number1 * number2 
        elif operator == "/":
            if number2 != "0":
                  result = number1 / number2
            else:
                print('错误: 除数不能为零')
                continue
        else:
            print('输入的操作符有问题')
        print(f'计算结果: {result}')
        a = input('请问还要继续吗? (y/n): ').strip().lower()
        if a != "y":
            break
    except ValueError:
        print('错误: 请输入有效的数字')
